home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso
/
shareware
/
management
/
screenmod
/
source
/
iconify.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-17
|
1KB
|
56 lines
/*********************** iconify ************************\
* Written by Syd L. Bolton ©1991 Legendary Design *
* Module for ScreenMod ... Date: May 2, 1991 *
\********************************************************/
#include "iconify.h"
iconify()
{
struct Window *IWindow;
struct IntuiMessage *message;
ULONG class;
int icon_exit=0;
if (Window) ClearMenuStrip(Window);
if (Window) CloseWindow(Window);
if (Screen) CloseScreen(Screen); /* this finishes off main program */
IWindow=OpenWindow(&IconWindow);
if (IWindow==NULL) {
puts("Couldn't open tiny window!!!");
exit(1);
}
/* now sleep until something happens ... */
do {
WaitPort(IWindow->UserPort);
while ( ( message=(struct IntuiMessage *)
GetMsg(IWindow->UserPort) ) != NULL)
{
class=message->Class;
ReplyMsg(message);
if (class==MOUSEBUTTONS) icon_exit=1;
if (class==CLOSEWINDOW) icon_exit=2;
}
} while (icon_exit==0);
CloseWindow(IWindow);
if (icon_exit==2) {
if (GfxBase) CloseLibrary(GfxBase);
if (IntuitionBase) CloseLibrary(IntuitionBase);
exit(1);
}
opendisplay();
screenlist();
scr=0;
updatestats();
return(0);
}